package com.lysj.admin.master.bussiness.company.invoice.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lysj.admin.master.common.enumeration.EnumInterface;
import com.lysj.admin.master.common.spring.mpbase.MyEntity;
import com.lysj.admin.master.common.validation.annotation.Min;
import com.lysj.admin.master.common.validation.annotation.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author Created by drj on 2020-01-08 19:13
 * @description 发票申请子项
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@TableName("lysj_company_invoice_apply_item")
@Table(name = "lysj_company_invoice_apply_item")
public class InvoiceApplyItem extends MyEntity {


    @Getter
    public enum InvoiceStatus implements EnumInterface {
        AUDITING(1, "待审核"),
        AGREE(2, "同意"),
        REJECTED(3, "驳回");

        private Integer code;
        private String status;

        InvoiceStatus(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    private String invoiceApplyId; //发票申请id

    //-------------------------购买方--------------------------------
    private String invoiceEnterprise; //名称
    private String invoiceTaxNumber;//纳税人识别号
    private String invoiceAddress;//地址
    private String invoicePhone;//手机号
    private String invoiceBank;//开户行
    private String invoiceAccount;//账号

    //-------------------------销售方--------------------------------
    private String serName;//名称
    private String serTaxNumber;//纳税人识别号
    private String serAddress;//地址
    private String serPhone;//联系方式
    private String serBankName;//开户银行
    private String serAccountName;//账户名称

    //-------------------收件人--------------------------
    private String recPhone;//手机号
    private String recName;//姓名
    private String recAddress;//地址


    @Column(columnDefinition = "decimal(10,2)")
    @Min(value = "0", message = "开票金额必须大于0")
    private BigDecimal invoicePrice;//开票金额
    private String goodsName;//货物名称 用-拼接,比如(货物1-货物2)
    private Integer invoiceStatus;//开票状态
    private transient String invoiceStatusTxt;
}
